﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentValidation;

namespace Microhard.Permission.Validator
{
    public class ResourceTypeValidator : AbstractValidator<Microhard.Permission.Models.ResouceType>
    {
        public ResourceTypeValidator()
        {
           RuleSet("Insert", () =>
           {
               RuleFor(u => u.Name).NotEmpty().WithMessage("请填写资源类型名称");
               RuleFor(u => u.KeyName).NotEmpty().WithMessage("请填写资源类型KeyName");
           });

           RuleSet("Update", () =>
           {
               RuleFor(u => u.Name).NotEmpty().WithMessage("请填写资源类型名称");
               RuleFor(u => u.KeyName).NotEmpty().WithMessage("请填写资源类型KeyName");
           });

           RuleSet("Delete", () =>
           {
              
           });
        }
    }
}
